<?php
session_start();
	
	require_once '../lib/sql.utils.php';
	$sql_util = new SqlUtils();
	
	$result = $sql_util -> getRows('SELECT * FROM categories');
	$temp = '
	<div class="menu">
		Quản lý giá sách > Thêm giá sách
	</div>
	<hr />
	<form id="myForm" name="myForm" method="post" enctype="multipart/form-data" action="service/process_add_category_detail.php">
		<label for="name">Tên Giá sách :</label>
		<input type="text" id="name" name="name" placeholder="Category name" />
		<span id="check-name"></span>
		<br />
		';
	$temp .= '<label for="category" >Thuộc Danh Mục</label>';
	$temp .= '<select name="category" id="category">';
	for ($i=0; $i < count($result); $i++) { 
		$temp .= '<option value="'.$result[$i]['categoryId'].'" >'.$result[$i]['categoryName']. '</option>';
	}
	$temp .= '</select>';
	$temp .= '<label for="description">Ghi chú :</label>
		<textarea id="description" name="description" rows="10" cols="70"></textarea><span id="check-description"></span>
		<br />
		<input type="submit" id="button" name="button" value="Submit"/>
	</form>';
	$_SESSION['data'] = 'displayFormAddCategory';
	echo $temp;
?>
